import Vue from 'vue'
import router from 'vue-router'
// import HelloWorld from '@/components/HelloWorld'
// import Home from '@/views/home/home.vue'
// import Login from '../login/login.vue'

Vue.use(router) //注入路由组件

// 创建router 实例 并导出
export default new router({
  // 定义路由 添加映射关系
  routes: [{
      path: '/',
      redirect: '/login',
    },
    {
      path: '/login',
      component: () => import('@/views/login/login'),
      // hidden: true
    },
    {
      path: '/home', //布局页
      component: () => import('@/views/home/home'),

      children: [{
          path: '/index',
          component: () => import('@/views/home/index'),
          meta: {
            title: '首页'
          }
        },
        {
          path: '/bable',
          component: () => import('@/views/bable/index'),
          meta: {
            title: '票据管理'
          }
        },
        {
          path: '/message',
          component: () => import('@/views/message/index'),
          meta: {
            title: '信息管理'
          },
          children: [{
            path: '/messageList',
            component: () => import('@/views/message/messageList'),
            meta: {
              title: '信息列表'
            }
          }]
        },
        {
          path: '/stats',
          component: () => import('@/views/stats/index'),
          meta: {
            title: '数据管理'
          }
        },
        {
          path: '/users',
          component: () => import('@/views/users/index'),
          meta: {
            title: '用户管理'
          }
        }
      ]
    },

  ]
})
